import axios from 'axios'
import { nanoid } from 'nanoid'
import { defineStore } from 'pinia'
export const useLoveTalkStore = defineStore('loveTalk', {
  state: () => {
    return {
      talkList: JSON.parse(localStorage.getItem('talkList') as string) || [],
    }
  },
  actions: {
    getTalk() {
      let obj = { id: nanoid(), title: '这是新增的话语' }
      this.talkList.push(obj)
    },
    clearTalk() {
      this.talkList = []
    },
  },
})
